package com.gui.util;

/**
 * Created by Gui on 2017/7/19.
 */
public class Constants {

    /**
     * CRLF.
     */
    public static final String CRLF = "\r\n";

    /**
     * CR.  13
     */
    public static final byte CR = '\r';

    /**
     * LF.   10
     */
    public static final byte LF = '\n';

  /*  *//**
     * status reply.
     *//*
    public static final char SR = '+';

    *//**
     * error reply.
     *//*
    public static final char ER = '-';

    *//**
     * integer reply.
     *//*
    public static final char IR = ':';

    *//**
     * bulk reply.
     *//*
    public static final char BR = '$';

    *//**
     * multi bulk reply.
     *//*
    public static final char MBR = '*';*/


    /** ****************************** RDB begin ************************************ */

    public static final String REDIS_RDB_MAGIC_STR = "REDIS";

    public static final int REDIS_RDB_VERSION       = 7;

    public static final int REDIS_RDB_TYPE_STRING   = 0;
    public static final int REDIS_RDB_TYPE_LIST     = 1;
    public static final int REDIS_RDB_TYPE_SET      = 2;
    public static final int REDIS_RDB_TYPE_ZSET     = 3;
    public static final int REDIS_RDB_TYPE_HASH     = 4;

    public static final int REDIS_RDB_TYPE_HASH_ZIPMAP      = 9;
    public static final int REDIS_RDB_TYPE_LIST_ZIPLIST     = 10;
    public static final int REDIS_RDB_TYPE_SET_INTSET       = 11;
    public static final int REDIS_RDB_TYPE_ZSET_ZIPLIST     = 12;
    public static final int REDIS_RDB_TYPE_HASH_ZIPLIST     = 13;
    public static final int REDIS_RDB_TYPE_LIST_QUICKLIST   = 14;

    public static final int REDIS_RDB_OPCODE_AUX            = 250;
    public static final int REDIS_RDB_OPCODE_RESIZEDB       = 251;
    public static final int REDIS_RDB_OPCODE_EXPIRETIME_MS  = 252;
    public static final int REDIS_RDB_OPCODE_EXPIRETIME     = 253;
    public static final int REDIS_RDB_OPCODE_SELECTDB       = 254;
    public static final int REDIS_RDB_OPCODE_EOF            = 255;

    public static final String REDIS_INSERT_STRING          = "set";
    public static final String REDIS_INSERT_LIST            = "rpush";
    public static final String REDIS_INSERT_SET             = "sadd";
    public static final String REDIS_INSERT_ZSET            = "zadd";
    public static final String REDIS_INSERT_HASH            = "hmset";

    public static final String REDIS_SET_CMD_EXPIRE_SECOND_PREFIX       = "EX";
    public static final String REDIS_SET_CMD_EXPIRE_MILLISECOND_PREFIX  = "PX";

    public static final int REDIS_TIME_NONE                 = 0;
    public static final int REDIS_TIME_SECOND               = 1;
    public static final int REDIS_TIME_MILLISECOND          = 2;
    public static final int REDIS_TIME_MICROSECOND          = 3;

    /** ****************************** RDB end ************************************ */

}
